/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright 2018 NXP
 */

#ifndef TEST_CRYPTODEV_SECURITY_IPSEC_TEST_VECTORS_H_
#define TEST_CRYPTODEV_SECURITY_IPSEC_TEST_VECTORS_H_

/* keys */
static uint8_t aes_cbc_key_0[] = {
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

static uint8_t hmac_sha1_key_0[] = {
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00 };

/* test vectors */
static uint8_t ipsec_cipher_text_aes_sha1_64B[] = {
	0x45, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x40, 0x32,
	0x1f, 0x22, 0xac, 0x10, 0x01, 0x01, 0xac, 0x10, 0x02, 0x01,
	0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
	0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
	0x0c, 0x0d, 0x0e, 0x0f, 0xcf, 0x06, 0xea, 0x67, 0x54, 0xa3,
	0xe5, 0x3f, 0x67, 0x49, 0x0e, 0xe2, 0x16, 0x7c, 0xdd, 0x22,
	0x2f, 0x08, 0x0b, 0x39, 0x21, 0x8e, 0x31, 0xf6, 0xdc, 0x10,
	0x82, 0x7b, 0xb5, 0x5c, 0xe3, 0x98, 0x36, 0x8d, 0x4b, 0xf5,
	0x84, 0x2f, 0x32, 0xc2, 0xde, 0x2b, 0x79, 0xcf, 0x16, 0xce,
	0x49, 0x37, 0xf0, 0xce, 0x66, 0x8b, 0x0b, 0x7e, 0x80, 0x8c,
	0x76, 0x5d, 0xb3, 0x50, 0xd0, 0x15, 0x92, 0x1d, 0x30, 0x92,
	0x9a, 0x87, 0xef, 0xb6, 0x1d, 0x9d, 0x2b, 0x64, 0x06, 0x07,
	0x2c, 0x3f, 0x28, 0xb4, 0x2c, 0xcb, 0x89, 0x4e, 0xdb, 0x4c,
	0xb9, 0x49, 0x84, 0x5f, 0x39, 0x9e};

/* test vectors */
static uint8_t ipsec_cipher_text_aes_64B[] = {
	0x45, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x40, 0x32,
	0x1f, 0x2e, 0xac, 0x10, 0x01, 0x01, 0xac, 0x10, 0x02, 0x01,
	0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
	0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
	0x0c, 0x0d, 0x0e, 0x0f, 0xcf, 0x06, 0xea, 0x67, 0x54, 0xa3,
	0xe5, 0x3f, 0x67, 0x49, 0x0e, 0xe2, 0x16, 0x7c, 0xdd, 0x22,
	0x2f, 0x08, 0x0b, 0x39, 0x21, 0x8e, 0x31, 0xf6, 0xdc, 0x10,
	0x82, 0x7b, 0xb5, 0x5c, 0xe3, 0x98, 0x36, 0x8d, 0x4b, 0xf5,
	0x84, 0x2f, 0x32, 0xc2, 0xde, 0x2b, 0x79, 0xcf, 0x16, 0xce,
	0x49, 0x37, 0xf0, 0xce, 0x66, 0x8b, 0x0b, 0x7e, 0x80, 0x8c,
	0x76, 0x5d, 0xb3, 0x50, 0xd0, 0x15, 0x92, 0x1d, 0x30, 0x92,
	0x9a, 0x87, 0xef, 0xb6, 0x1d, 0x9d, 0x2b, 0x64, 0x06, 0x07,
	0x2c, 0x3f, 0x28, 0xb4};

static uint8_t ipsec_plaintext_encrypt_64B[] = {
	0x45, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0xff, 0x11,
	0xd4, 0x58, 0xc0, 0xa8, 0x65, 0x02, 0xc0, 0xa8, 0x01, 0x01,
	0x04, 0x00, 0x04, 0x00, 0x00, 0x2c, 0x7f, 0xff, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x90, 0x42};

/* Plain text is different for decryption because above cipher text is
 * calculated after decrementing TTL in case of protocol offload in
 * driver for above plain text.
 */
static uint8_t ipsec_plaintext_decrypt_aes_sha1_64B[] = {
	0x45, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x11,
	0xd5, 0x58, 0xc0, 0xa8, 0x65, 0x02, 0xc0, 0xa8, 0x01, 0x01,
	0x04, 0x00, 0x04, 0x00, 0x00, 0x2c, 0x7f, 0xff, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x90, 0x42};

#define DEFAULT_SPI 0x1

uint8_t src_ip[] = {0xac, 0x10, 0x01, 0x01};
uint8_t dst_ip[] = {0xac, 0x10, 0x02, 0x01};

#endif /* TEST_CRYPTODEV_SECURITY_IPSEC_TEST_VECTORS_H_ */
